<?php
	// $name = $_GET["name"];
	// $message = $_GET["message"];
	$con = mysql_connect("localhost:3306","root","root");
	if(!$con){
		die("无法连接");
	}

	mysql_select_db("message",$con);
	mysql_query("set names 'utf8'");

	$result = mysql_query("SELECT * FROM t_message");
	$data = array();
	while($row = mysql_fetch_array($result)){
		$mes = array("id"=>$row['id'],"name"=>$row['name'],"message"=>$row['message']);
		array_push($data,$mes);
	}

	echo json_encode($data);
	mysql_close($con);
?>